<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="Question[@Type=10]">
	<div style="font-family:tahoma;
	font-size:14pt;
	color:black;
	padding-top:10px;padding-left:10px;padding-bottom:20px;">
	<xsl:value-of select="@Question"/>
	<br/><span class="body9">(<xsl:value-of select="@Comment"/>)</span>
	</div>
</xsl:template>

<xsl:template match="Question[@Type=2]">
<div>!!
	<span class="body" style="
	padding-top:10px;padding-left:10px;
	width:200px;">
	<xsl:value-of select="@Description"/>
	</span>
	<xsl:variable name="radioID" select="concat('S',@ID)"></xsl:variable>

	<xsl:choose>
	<xsl:when test='@P1="1"'>
		<xsl:for-each select="Answer">
			<xsl:choose>
				<xsl:when test='@Selected="1"'><span><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></span></xsl:when>
				<xsl:when test='@Selected="0"'><span><input type="radio" value="{@ID}" name="{$radioID}"></input></span></xsl:when>
			</xsl:choose>
			<span class="body"><xsl:value-of select="."/></span>
		</xsl:for-each>
	</xsl:when>
	<xsl:when test='@P1="2"'>
		<xsl:for-each select="Answer">
				<xsl:choose>
					<xsl:when test='@Selected="1"'><span><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></span></xsl:when>
					<xsl:when test='@Selected="0"'><span><input type="radio" value="{@ID}" name="{$radioID}"></input></span></xsl:when>
				</xsl:choose>
			<span class="body"><xsl:value-of select="."/></span>
				<br/>
		</xsl:for-each>
	</xsl:when>
	</xsl:choose>
</div>
</xsl:template>

  <xsl:template match="Question[@Type=1]">
    <div>
      <table width="100%">
        <tr>
          <td width="20%">
            <xsl:value-of select="@Description"/>
          </td>
          <td>
            <select class="body" size="1" name="S{@ID}">
              <xsl:for-each select="Answer">
                <option value="{@ID}">
                  <xsl:value-of select="."/>
                </option>
              </xsl:for-each>
            </select>
          </td>
        </tr>
      </table>
    </div>
  </xsl:template>

  <xsl:template match="Question[@Type=1 and @ID=3]">
    <div>
      <table width="100%">
        <tr>
          <td width="20%">
            <xsl:value-of select="@Description"/>
          </td>
          <td>
            <div>
              <select name="country" id="country" onchange="javascript:updateRegions();">
                <option value="none" selected="true" disabled="true">
                  select a country
                </option>
                <option value="" disabled="true">
                  ------------------
                </option>
                <xsl:for-each select="/searchUser/countries/country">
                  <xsl:choose>
                    <xsl:when test='@iso2=/searchUser/@countrycode'>
                      <option value="{@iso2}" selected="true">
                        <xsl:value-of select="@name"/>
                      </option>
                    </xsl:when>
                    <xsl:otherwise>
                      <option value="{@iso2}">
                        <xsl:value-of select="@name"/>
                      </option>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:for-each>
              </select>
            </div>
            <div>
              <select name="region" id="region" onchange="">
                <option value="none" selected="true" disabled="true">
                  select a region
                </option>
                <option value="" disabled="true">
                  ------------------
                </option>
                <xsl:for-each select="/searchUser/regions/region">
                  <xsl:choose>
                    <xsl:when test='@fips_region=/searchUser/@fips_region'>
                      <option value="{@fips_region}" selected="true">
                        <xsl:value-of select="@name"/>
                      </option>
                    </xsl:when>
                    <xsl:otherwise>
                      <option value="{@fips_region}">
                        <xsl:value-of select="@name"/>
                      </option>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:for-each>
              </select>
            </div>
            <div>
              <input type="hidden" id="citycode" name="citycode" value=""/>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </xsl:template>

  <xsl:template match="Question[@Type=8]">
<center>
<div style="padding-top:15px;padding-left:10px;padding-bottom:20px;">
<input type="submit" name="{concat('SUBMIT',@ID)}" value="{@Description}"></input>
</div>
</center>
</xsl:template>


<xsl:template match="searchUser">

<form name="formRegistration" method="post" action="{@action}" onSubmit="validateForm();return document.returnValue">
<input type="hidden" name="FORM_FINDADVANCED" value="01"/>

<xsl:apply-templates/>

</form>

</xsl:template>

</xsl:stylesheet>